//
//  ZSEditViewController.m
//  Timy
//
//  Created by zsj1992 on 16/12/14.
//  Copyright © 2016年 bjhj. All rights reserved.
//

#import "ZSEditViewController.h"
#import "ZSFeeItemCell.h"
@interface ZSEditViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
@property (weak, nonatomic) IBOutlet UICollectionViewFlowLayout *flowlayout;

@end

@implementation ZSEditViewController


- (IBAction)btnDismiss:(id)sender {
    
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    self.collectionView.backgroundColor = [UIColor whiteColor];
    UINib * nib = [UINib nibWithNibName:@"ZSFeeItemCell" bundle:[NSBundle mainBundle]];
    [self.collectionView registerNib:nib forCellWithReuseIdentifier:@"feeItemCell"];
    
    self.flowlayout.scrollDirection=UICollectionViewScrollDirectionVertical;
    self.collectionView.pagingEnabled = YES;
    
    //CGFloat minMarginX = 20;
    //NSInteger Column = SCREEN_W>320?6:5;
    //CGFloat itemW = (SCREEN_W-20-(minMarginX*(Column-1)))/Column;
    
    self.flowlayout.itemSize = CGSizeMake(70, 70);
    //self.flowlayout.minimumInteritemSpacing = 20;
    //self.flowlayout.minimumLineSpacing = 20;
    
}


-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{

    return 37;
    
}


-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{

    ZSFeeItemCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"feeItemCell" forIndexPath:indexPath];
    
    cell.lblTitle.text = [NSString stringWithFormat:@"第%ld个",indexPath.row];
    
    
    if (indexPath.row==1) {
        cell.lblTitle.text = @"我是你的哒";
        
    }
    
    
    return cell;
    
}



-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{

    return UIEdgeInsetsMake(0, 0, 0, 0);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

}



@end
